#ifndef _IMAGE_SAVE_SAVE_
#define _IMAGE_SAVE_SAVE_

#include "../../../function.h"

namespace sp::Image::Save{

void registe_save();

class save: public Function{
private:
    std::string path;
    char* video_ptr_head;
    char* current_video_ptr;
    int fps;
    long size;
    int width;
    int height;
    long index;
    cv::VideoWriter writer;
public:
    save(std::vector<std::string> v); // std::string path, int fps, int width, int height
    save(std::string path, char* video_ptr_head, long size, int fps, int width, int height);
    save();
    virtual ~save();
    static void registe();
    static Function* createObject(std::vector<std::string> params);
    static Function* createObject2();
    virtual void start();
    virtual bool waitForResource();
    virtual void process(std::vector<std::vector<Data*>>& data_input, std::vector<Data*>& data_output);
    virtual bool releaseResource();
    virtual void finish();
    virtual bool process();
    virtual void copy(Function* other);
};

};

#endif